package com.weike.wk_android.view.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.trello.rxlifecycle3.components.RxActivity;
import com.weike.wk_android.R;
import com.weike.wk_android.utils.Utils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 详情页面
 */
public class InformationDetailActivity extends RxActivity {
    @BindView(R.id.title_left)
    ImageView titleLeft;
    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.title_right)
    ImageView titleRight;
    @BindView(R.id.comment_et)
    EditText commentEt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_information_detail);
        ButterKnife.bind(this);

        init();
    }

    /**
     * 初始化数据信息
     */
    private void init() {
        initTitle();
    }

    /**
     * 初始化Title
     */
    private void initTitle() {
        titleLeft.setImageResource(R.mipmap.back);
        title.setText(Utils.getString(R.string.infor_detail));
        titleRight.setImageResource(R.mipmap.share);
    }

    @OnClick({
            R.id.title_left,
            R.id.title_right,
            R.id.fav,
            R.id.zan,
            R.id.comment,
            R.id.share_icon
    })
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.title_left:
                left();
                break;
            case R.id.title_right:
                share();
                break;
            case R.id.fav:
                fav();
                break;
            case R.id.zan:
                zan();
                break;
            case R.id.comment:
                comment();
                break;
            case R.id.share_icon:
                share();
                break;
        }
    }

    /**
     * 评论
     */
    private void comment() {
    }

    /**
     * 点赞
     */
    private void zan() {
    }

    /**
     * 收藏
     */
    private void fav() {
    }

    /**
     * 分享
     */
    private void share() {
    }

    /**
     * 返回上一层
     */
    private void left() {
        finish();
    }
}
